package diamonds;

import javax.faces.event.ActionEvent;

import com.backbase.bjs.event.CustomActionEvent;
import com.backbase.bjs.component.UIBackbaseCommandButton;
import com.backbase.bjs.component.UIBackbaseOutputText;

public class BackingBean {
	private UIBackbaseCommandButton button1;
	private UIBackbaseOutputText calcoutput;

	private String button1Title = "Backbase commandButton";
	
	public UIBackbaseCommandButton getButton1() {
		return button1;
	}

	public String getButton1Title() {
		return button1Title;
	}

	public void setButton1(UIBackbaseCommandButton button1) {
		this.button1 = button1;
	}

	public void printAttribute(CustomActionEvent event) {
		System.out.print("First name is: " + event.getAtts().get("firstname"));
	}

	private UIBackbaseCommandButton button2;

	private boolean button2Rendered;

	public UIBackbaseCommandButton getButton2() {
		return button2;
	}

	public void setButton2(UIBackbaseCommandButton button2) {
		this.button2 = button2;
	}

	public void addTwoNumbers() {
		calcoutput.setValue(44 + 33);
	}

	public String someBusinessLogic2() {
		System.out.println("A second server side action!!!!");
		return null;
	}
	
	public void doTwo(ActionEvent event) {
		button2Rendered = false;
	}

	public boolean isButton2Rendered() {
		return button2Rendered;
	}

	public void setButton2Rendered(boolean button2Rendered) {
		this.button2Rendered = button2Rendered;
	}

	public UIBackbaseOutputText getCalcoutput() {
		return calcoutput;
	}

	public void setCalcoutput(UIBackbaseOutputText calcoutput) {
		this.calcoutput = calcoutput;
	}
}